package com.daiqile.myinterest.activity;

import android.os.Build;
import android.os.Bundle;
import android.transition.Slide;
import android.view.Gravity;

import com.daiqile.myinterest.R;
import com.daiqile.myinterest.utils.SwipeBackActivity;
import com.daiqile.myinterest.utils.SwipeBackLayout;

public class NextActivity extends SwipeBackActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_next);
        setDragEdge(SwipeBackLayout.DragEdge.TOP);
//        setDragDirectMode(SwipeBackLayout.DragDirectMode.VERTICAL);
        Slide mSlide = null;
        Slide nSlide = null;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            mSlide = new Slide();
            nSlide = new Slide();
            nSlide.setSlideEdge(Gravity.TOP);
            nSlide.setDuration(1000);
            mSlide.setDuration(1000);
            mSlide.setSlideEdge(Gravity.BOTTOM);
            getWindow().setEnterTransition(mSlide);
            getWindow().setExitTransition(nSlide);
        }
    }
}
